﻿<navigation:Page x:Class="SGTLightAccent.Views.Depositos" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
           xmlns:behaviors="clr-namespace:SGTLightAccent.Models"
           Title="Depositos Page"
           Language="es-ES"
           DataContext="{Binding Depositos, Source={StaticResource Locator}}" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" d:DesignHeight="895" d:DesignWidth="774" xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit">
	<sdk:Page.Resources>
<!-- When defining your own styles, set "based on" the same way to keep control theming -->
		<Style x:Key="ButonImagen" TargetType="Button" BasedOn="{StaticResource DefaultButtonStyle}" >
			
		</Style>
	</sdk:Page.Resources>
	
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="600*" />
        </Grid.RowDefinitions>
        <sdk:TabControl Name="tabControl1" TabStripPlacement="Top"  BorderThickness="1" Margin="0,0,0,0">
            <sdk:TabItem Header="Ingreso a deposito" Height="33" VerticalAlignment="Center">

                <StackPanel>
                    <Border BorderBrush="Silver" BorderThickness="1" Height="143" HorizontalAlignment="Center" Margin="10,10,0,0" Name="borderDescagas" VerticalAlignment="Top" Width="534"  >
                        <Grid Background="White" HorizontalAlignment="Left" Width="533" Height="142" VerticalAlignment="Top">
                            <sdk:Label Content="Barco" FontWeight="Bold" Height="28" HorizontalAlignment="Right" HorizontalContentAlignment="Right" Margin="0,14,460,0" x:Name="labeld1" VerticalAlignment="Top" Width="62" />
                            <sdk:Label Content="Entre" FontWeight="Bold" Height="28" HorizontalAlignment="Right" HorizontalContentAlignment="Right" Margin="0,54,460,0" x:Name="labeld2" VerticalAlignment="Top" Width="62" />
                            <sdk:Label Content="Cliente" FontWeight="Bold" Height="28" HorizontalAlignment="Right" HorizontalContentAlignment="Right" Margin="0,12,223,0" x:Name="labeld3" VerticalAlignment="Top" Width="67" />
                            <TextBox Height="28" HorizontalAlignment="Left" IsReadOnly="False" Margin="79,12,0,0" x:Name="textBoxd1" Text="{Binding Mode=TwoWay, Path=FiltroBarco}" VerticalAlignment="Top" Width="117" />
                            <TextBox Height="28" HorizontalAlignment="Right" Margin="0,12,37,0" x:Name="textBoxd3" Text="{Binding Mode=TwoWay, Path=FiltroProducto}" VerticalAlignment="Top" Width="180" />
                            <Button Command="{Binding BotonBuscarCarga}" Content="Buscar" Height="33" Margin="0,103,6,0" x:Name="buttond2" Width="65" VerticalAlignment="Top" HorizontalAlignment="Right" />
                            <sdk:DatePicker Height="28" HorizontalAlignment="Left" Margin="79,54,0,0" x:Name="datePicker1" VerticalAlignment="Top" Width="117" SelectedDate="{Binding Path=FiltroFechaIni, Mode=TwoWay}" />
                            <sdk:Label Content="y" FontWeight="Bold" Height="28" HorizontalContentAlignment="Center" Margin="238,56,223,0" x:Name="label4" VerticalAlignment="Top" HorizontalAlignment="Center" Width="67" />
                            <sdk:DatePicker Height="28" HorizontalAlignment="Left" Margin="316,56,0,0" x:Name="datePicker2" VerticalAlignment="Top" Width="180" SelectedDate="{Binding Path=FiltroFechaFin, Mode=TwoWay}" />
                            <CheckBox HorizontalAlignment="Center" Margin="202,14,306,104" Name="chkBarco" VerticalAlignment="Center" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" RenderTransformOrigin="0.6,0.5" IsChecked="{Binding Path=FiltroChkBarco, Mode=TwoWay}" />
                            <CheckBox HorizontalAlignment="Center" HorizontalContentAlignment="Center" Margin="202,54,306,64" Name="chkFchIni" VerticalAlignment="Center" VerticalContentAlignment="Center" IsChecked="{Binding Path=FiltroChkFchIni, Mode=TwoWay}" />
                            <CheckBox HorizontalAlignment="Center" HorizontalContentAlignment="Center" Margin="498,14,10,104" Name="chkProducto" VerticalAlignment="Center" VerticalContentAlignment="Center" IsChecked="{Binding Path=FiltroChkProducto, Mode=TwoWay}" />
                            <CheckBox HorizontalAlignment="Center" HorizontalContentAlignment="Center" Margin="498,56,10,62" Name="chkFchFin" VerticalAlignment="Center" VerticalContentAlignment="Center" IsChecked="{Binding Path=FiltroFechaFin, Mode=TwoWay}" />
                        </Grid>
                    </Border>
                    <Grid Height="331" Name="grid1" Width="748" Margin="0,20,0,0">
                        
                        
                        <sdk:DataGrid AutoGenerateColumns="False" Margin="0,6,0,-37" ItemsSource="{Binding Path=Cargas}" Name="dataGrid2"  SelectionMode="Single" SelectedItem="{Binding Path=CargaSeleccionada, Mode=TwoWay}" Loaded="dataGrid2_Loaded">
                            <sdk:DataGrid.Columns>
                                <sdk:DataGridTextColumn Binding="{Binding Path=Id}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="N°" Width="50" IsReadOnly="True" />
                                <sdk:DataGridTextColumn Binding="{Binding Path=Barco.Nombre}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Barco" Width="170" IsReadOnly="True" />
                                <sdk:DataGridTextColumn Binding="{Binding Path=Fecha_Ingreso}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Fecha entrada" Width="125*" IsReadOnly="True" />
                                <sdk:DataGridTextColumn Binding="{Binding Path=Proveedor.Nombre}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Cliente" Width="125*" IsReadOnly="True" />
                               
                                <sdk:DataGridTextColumn Binding="{Binding Path=Peso}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Carga Neta" Width="110" IsReadOnly="True"/>
                             
                            </sdk:DataGrid.Columns>
                            <i:Interaction.Behaviors>
                                <behaviors:DataGridDoubleClickBehavior
                                        DoubleClickCommand="{Binding Path=BotonNavegarRemito}" 
                                        CommandParameter="{Binding SelectedItem, ElementName=dataGrid2}"
                                        DoubleClick="dataGrid2_DoubleClick"/>

                            </i:Interaction.Behaviors>
                        </sdk:DataGrid>
                        
                            <toolkit:BusyIndicator IsBusy="{Binding Path=EstaCargando}" DisplayAfter="0" BusyContent="Buscando descargas...">
                                
                            </toolkit:BusyIndicator>
                        
                    </Grid>
                </StackPanel>

            </sdk:TabItem>
            <sdk:TabItem Header="Adm. Depositos" VerticalAlignment="Center" Height="33" >
                <StackPanel>
                    <Border BorderBrush="Silver" BorderThickness="1" Height="119" HorizontalAlignment="Center" Margin="10,10,0,0" Name="border1" VerticalAlignment="Top" Width="273" Background="{x:Null}">
                        <Grid Background="White">
                            <sdk:Label Content="Deposito" FontWeight="Bold" Height="28" HorizontalAlignment="Left" HorizontalContentAlignment="Right" Margin="10,12,0,0" Name="label1" VerticalAlignment="Top" Width="70" />
                            <TextBox Height="23" HorizontalAlignment="Left" Margin="78,10,0,0" Name="textBox1" VerticalAlignment="Top" Width="165" />
                            <Button Command="{Binding Path=BotonBuscarDeposito}" Content="Buscar" Height="33" Margin="0,56,27,0" Name="button2" VerticalAlignment="Top" HorizontalAlignment="Right" Width="74" />
                        </Grid>
                    </Border>
                    <Grid Height="439" Name="grid2" Width="697" Margin="20,20,0,0">
                        <sdk:DataGrid AutoGenerateColumns="False" ItemsSource="{Binding Path=Depositos}" Margin="0,39,0,6" Name="dataGrid3" SelectionMode="Single" SelectedItem="{Binding Path=DepositoSeleccionado, Mode=TwoWay}">
                            <sdk:DataGrid.Columns>
                                <sdk:DataGridTextColumn Binding="{Binding Path=DepositoID}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="N° Deposito" Width="50" IsReadOnly="True" />
                                <sdk:DataGridTextColumn Binding="{Binding Path=Nombre}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Deposito" Width="120*" IsReadOnly="True" />
                                <sdk:DataGridTextColumn Binding="{Binding Path=Direccion}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Dirección" Width="200*" IsReadOnly="True" />
                            </sdk:DataGrid.Columns>
                            <i:Interaction.Behaviors>
                                <behaviors:DataGridDoubleClickBehavior
                                        DoubleClickCommand="{Binding Path=BotonModificarDeposito}" 
                                        CommandParameter="{Binding SelectedItem, ElementName=dataGrid3}"
                                        />

                            </i:Interaction.Behaviors>
                        </sdk:DataGrid>
                        <Button Command="{Binding Path=BotonNuevoDeposito}" Content="Nuevo" Height="33" Name="buttond3" Width="65" HorizontalAlignment="Left" Margin="0,0,0,406" />
                    </Grid>
                    
                </StackPanel>



            </sdk:TabItem>
        </sdk:TabControl>

    </Grid>
</navigation:Page>
